import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  },
  routes: [
    {
      path: '/',
      name: 'Home',
      component: resolve => require(['@/pages/index/index'],resolve),
      meta: { title: '首页' }
    },
    {
      path: '/home',
      name: 'Home',
      component: resolve => require(['@/pages/index/index'],resolve),
      meta: { title: '首页' }
    },
    {
      path: '/product',
      name: 'Product',
      component: resolve => require(['@/pages/product/index'],resolve),
      meta: { title: '产品' }
    },
    {
      path: '/product-detail',
      name: 'ProductDetail',
      component: resolve => require(['@/pages/product/detail'],resolve),
      meta: { title: '产品详情' }
    },
    {
      path: '/serve',
      name: 'Serve',
      component: resolve => require(['@/pages/serve/index'],resolve),
      meta: { title: '服务' }
    },
    {
      path: '/solution',
      name: 'Solution',
      component: resolve => require(['@/pages/solution/index'],resolve),
      meta: { title: '解决方案' }
    },
    {
      path: '/solution-detail',
      name: 'SolutionDetail',
      component: resolve => require(['@/pages/solution/detail'],resolve),
      meta: { title: '解决方案详情' }
    },
    {
      path: '/article',
      name: 'Article',
      component: resolve => require(['@/pages/article/index'],resolve),
      meta: { title: '新闻' }
    },
    {
      path: '/article-detail',
      name: 'ArticleDetail',
      component: resolve => require(['@/pages/article/detail'],resolve),
      meta: { title: '新闻详情' }
    },
    {
      path: '/case',
      name: 'Case',
      component: resolve => require(['@/pages/case/index'],resolve),
      meta: { title: '案例' }
    },
    {
      path: '/case-detail',
      name: 'CaseDetail',
      component: resolve => require(['@/pages/case/detail'],resolve),
      meta: { title: '案例详情' }
    },
    {
      path: '/about',
      name: 'About',
      component: resolve => require(['@/pages/about/index'],resolve),
      meta: { title: '关于朔悦' }
    },{
      path: '/product/report',
      name: 'Report',
      component: resolve => require(['@/pages/gzmian/report/index'],resolve),
      meta: { title: '报表平台' }
    },{
      path: '/product/daping',
      name: 'Daping',
      component: resolve => require(['@/pages/gzmian/daping/index'],resolve),
      meta: { title: '数据大屏' }
    },{
      path: '/product/dataprocess',
      name: 'Dataprocess',
      component: resolve => require(['@/pages/gzmian/dataprocess/index'],resolve),
      meta: { title: '数据集算' }
    }
  ]
})
